package com.luoran.bartalks.service.impl;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luoran.bartalks.dao.IBtPlanTemplateDao;
import com.luoran.bartalks.entity.BaseInfo;
import com.luoran.bartalks.entity.biz.BtPlanTemplate;
import com.luoran.bartalks.service.IBtPlanTemplateService;

@Service
public class BtPlanTemplateService implements IBtPlanTemplateService {

	@Autowired
	private IBtPlanTemplateDao dao;

	@Override
	public PageQuery<? extends BaseInfo> getQueryList(PageQuery<? extends BaseInfo> pageQuery) {
		dao.queryPage(pageQuery);
		return pageQuery;
	}

	@Override
	public BtPlanTemplate getBtPlanTemplateByCode(String planTemplateCode, String companyId) {
		return dao.getBtPlanTemplateByCode(planTemplateCode, companyId);
	}

	@Override
	public BtPlanTemplate addPlanTemplate(BtPlanTemplate planTemplate) {
			dao.insert(planTemplate);
		return planTemplate;
	}


	@Override
	public BtPlanTemplate getPlanTemplateById(String id) {
		return dao.single(id);
	}

	@Override
	public void deletePlanTemplate(String id) {
		dao.deleteById(id);
	}

	@Override
	public List<BtPlanTemplate> getBtPlanTemplateByCompanyId(String companyId) {
		return dao.getBtPlanTemplateByCompanyId(companyId);
	}

	@Override
	public BtPlanTemplate getBtPlanTemplateById(String id) {
		return dao.single(id);
	}

	@Override
	public void deleteBtPlanTemplateById(String id) {
		dao.deleteBtPlanTemplateById(id);
	}


	@Override
	public void updateBtPlanTemplateById(BtPlanTemplate btPlanTemplate) {
		dao.updateById(btPlanTemplate);
	}

	@Override
	public List<BtPlanTemplate> getPlanTemplateByTransportTypeId(String transportTypeId,String companyId) {
		
		return dao.getPlanTemplateByTransportTypeId(transportTypeId,companyId);
	}

	@Override
	public List<BtPlanTemplate> getPlanTemplateByCompanyId(String companyId) {
		return dao.getPlanTemplateByCompanyId(companyId);
	}

	@Override
	public List<BtPlanTemplate> getPlanTemplateStencilList(String companyId) {
		return dao.getPlanTemplateStencilList(companyId);
	}

}
